<?php

?>
<h2>
    <?php echo $this->translate('Exam Plugin') ?>
</h2>

<?php if(count($this->navigation)): ?>
<div class='tabs'>
        <?php
        // Render the menu
        //->setUlClass()
        echo $this->navigation()->menu()->setContainer($this->navigation)->render()
        ?>
</div>
<?php endif; ?>

<br />

<?php if(count($this->navigation_sub)): ?>
<div class='tabs'>
        <?php
        // Render the menu
        //->setUlClass()
        echo $this->navigation()->menu()->setContainer($this->navigation_sub)->render()
        ?>
</div>
<?php endif; ?>

<div class='clear'>
    <div class='settings'>
        <form class="global_form">
            <div>
                <?php if($this->paginator->getTotalItemCount() > 0):?>

                <table class='admin_table'>
                    <thead>

                        <tr>
                            <th><?php echo $this->translate("Category Name") ?></th>
                            <th><?php echo $this->translate("Options") ?></th>
                        </tr>

                    </thead>
                    <tbody>
                            <?php foreach ($this->paginator as $item): ?>

                        <tr>
                            <td><?php echo htmlspecialchars($item['faqcategory_name'])?></td>
                            <td>
                                <a class='smoothbox' href='<?php echo $this->url(array('action' => 'editfaqcategory', 'faqcategory_id' => $item['faqcategory_id']));?>'>
                                            <?php echo $this->translate("Edit") ?>
                                </a>
                                |
                                <a class='smoothbox' href='<?php echo $this->url(array('action' => 'deletefaqcategory', 'faqcategory_id' => $item['faqcategory_id']));?>'>
                                            <?php echo $this->translate("Delete") ?>
                                </a>
                            </td>
                        </tr>

                            <?php endforeach; ?>

                    </tbody>
                </table>

                <?php else:?>
                <br/>
                <div class="tip">
                    <span><?php echo $this->translate("EXAM_NO_FAQ_CATEGORY_DESCRIPTION") ?></span>
                </div>
                <?php endif;?>
                <br/>

                <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'exam', 'controller' => 'faq', 'action' => 'addfaqcategory'), $this->translate('Add New Category'), array(
                'class' => 'smoothbox buttonlink',
                'style' => 'background-image: url(application/modules/Core/externals/images/admin/new_category.png);')) ?>

                <br />
                <?php if( $this->paginator->count() > 1 ): ?>
                <br />
                    <?php echo $this->paginationControl($this->paginator, null, null); ?>
                <?php endif; ?>

            </div>
        </form>
    </div>
</div>